const router = require('koa-router')()
router.prefix('/api/category')
const { HttpException } = require('@core/http-exception')
// const { Category } = require('@model/category.js')
const { Category } = require('@model/super.js')
const { RegisterValidator } = require('@validator/validator.js')
const { SuccessModel } = require('@model/resModel')
const { Auth } = require('@middlewares/auth.js')

router.post('/create', async (ctx, next) => {
  const { name } = ctx.request.body
  const res = await Category.create({
    name
  })
  ctx.body = res
})

module.exports = router